package org.fujay.langchain4jserver.domain.conversation.event;

import lombok.Getter;
import org.fujay.langchain4jserver.domain.conversation.vo.ConversationId;
import org.fujay.langchain4jserver.domain.conversation.vo.MessageId;
import org.springframework.context.ApplicationEvent;

/**
 * Domain Event indicating an AI message has been added to a conversation.
 */
@Getter
public class AiMessageAddedEvent extends ApplicationEvent {

    // Getters
    private final ConversationId conversationId;
    private final MessageId aiMessageId;
    private final String aiMessageContent; // Include content for potential listeners

    /**
     * Create a new AiMessageAddedEvent.
     *
     * @param source           the component that published the event
     * @param conversationId   the ID of the conversation
     * @param aiMessageId      the ID of the added AI message
     * @param aiMessageContent the content of the added AI message
     */
    public AiMessageAddedEvent(
            Object source,
            ConversationId conversationId,
            MessageId aiMessageId,
            String aiMessageContent) {
        super(source);
        this.conversationId = conversationId;
        this.aiMessageId = aiMessageId;
        this.aiMessageContent = aiMessageContent;
    }
}
